<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="public::head('投票表决')">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8"></meta>

</head>
<body style="padding-top:50px;">
<input type="hidden" th:value="${session.Id}" id="id"/>
<input type="hidden" th:value="${session.Type}" id="Type"/>

<input type="hidden" th:value="${xiangmuId}" id="xiangmuId">
<input type="hidden" th:value="${xiangmuleixing}" id="xiangmuleixing">

<div th:replace="public/top_vote::top"></div>

<div id="Votelist">

    <div class="primary-title" >
        <div style="margin-top:5px;text-align: center;font-size:24px">
            <label  style="margin-left: 20px; ">{{xiangmu.xiangmuname}}</label>
            <span  class="btn btn-success" style="float:right;margin-right:15px;margin-top:5px;"
                   v-on:click="toRefresh()">刷新页面</span>
        </div>
        <div style="text-align: center;font-size:18px">
<!--            <label  style="margin-left: 20px; ">总数： {{total}} 保留： <font color="green">{{tongyishu}}</font> 淘汰： <font color="red">{{butongyishu}}</font></label>-->
            <label  style="margin-left: 20px;color: red ">您已勾选{{pinzhongshu}}个品种，您已勾选{{fenleishu}}个分类， {{pinguishu}}个品规，{{jicaiyaoshu}}个集采药，剩余{{shengyujicaiyaoshu}}个集采药未勾选</label>

            <input v-if="!issubmited" type="button" class="btn btn-sm btn-primary" style="width: 60px" value="提交" @click="tosubmit()">
            <input v-if="issubmited" type="button" class="btn btn-sm btn-success" disabled style="width: 60px" value="已提交" @click="tosubmit()">

            <a v-if="issubmited" target="_blank" class='btn btn-info'
               style='width:120px;height:34px;color:#fff !important;'
                :href="'/kangjunyaowujieguo/qianzibiao?xiangmuid='+xiangmuId+'&xiangmuleixing='+xiangmuleixing+'&userid='+userId">打印签字表</a>

            <a v-if="isallsubmited" target="_blank" class='btn btn-primary'
               style='width:120px;height:34px;color:#fff !important;'
               :href="'/main/huizongbiao?xiangmuid='+xiangmuId" >查看汇总表</a>

        </div>

        <div style="text-align: center;font-size:18px;padding-top: 5px">
            <label  style="margin-left: 20px;">药品名称：</label><input type="text" class="form-control" style="width: 150px;display:inline-block;"  v-model="drugname"  >
            <label  style="margin-left: 20px;">分类：</label><select class="select-form-control" style="width: 100px" v-model="fenlei">
            <option value="">-- 请选择 --</option>
            <option v-for="fenlei in fenleilist" v-text="fenlei.fenlei" :value="fenlei.fenleiid"></option>
        </select>
            <label  style="margin-left: 20px;">基药：</label> <select style="width: 70px" class="select-form-control" v-model="jiyao">
            <option value="">-- 请选择 --</option>
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
            <label  style="margin-left: 20px;">集采药：</label> <select style="width: 70px" class="select-form-control" v-model="jicaiyao">
            <option value="">-- 请选择 --</option>
            <option value="是">是</option>
            <option value="否">否</option>
        </select>
            <label  style="margin-left: 20px;">一致性评价：</label> <select style="width: 70px" class="select-form-control" v-model="yizhipingjia">
            <option value="">-- 请选择 --</option>
            <option value="是">是</option>
            <option value="原研">原研</option>
        </select>
            <label  style="margin-left: 20px;">15版指导原则：</label> <select style="width: 70px" class="select-form-control" v-model="yuanze">
            <option value="">-- 请选择 --</option>
            <option value="是">是</option>
            <option value="否">否</option>
        </select>

            <button class="btn btn-info" @click="findBiaojuelist()" style="margin-left:15px;">查询</button>
            <button class="btn btn-danger" @click="remove()" style="margin-left:15px;">清空</button>
        </div>


    </div>

    <div style="height: 100px"></div>


    <div class="primary-content">

        <div id="List" >
        </div>



        <div v-if="!show" style="text-align:center;width:100%;">查无数据</div>

        <div v-if="show" class="my-page-navigation">
            <button class="btn btn-default" v-on:click="SetPageIndex">首页</button>
            <button class="btn btn-default" v-on:click="SetPageIndexPrePage">上一页</button>
            <span v-text="pageIndex + '  /  ' + pageCount"></span>
            <span v-text="'共' + recordCount + '条品种'"></span>
            <button class="btn btn-default" v-on:click="SetPageIndexNextPage">下一页</button>
            <button class="btn btn-default" v-on:click="SetPageEnd">尾页</button>
            <span>跳到第</span>
            <input type="text" class="form-control" style="width: 80px;display:inline-block;"  v-model="inputPageIndexValue" v-on:keyup.enter="JumpPage">
            <span>页</span>
            <button class="btn btn-default" v-on:click="JumpPage">跳</button>
        </div>

    </div>

</div>

</body>

<style>
    table{
        border:1px solid #e6e6e6;
        /*line-height: 5vh;*/
        color:#666666;
        font-size: 16px;
    }
    table {
        border-collapse: collapse;
        width: 100%;
    }
    td {
        padding:5px;
        border:1px solid #e6e6e6;
        font-size: 14px;
    }
    .table-head{padding-right:17px;background-color: #CDCDCD;color:#000;height:135px;}
    .table-body{width:100%; height:300px;overflow-y:scroll;}
    .table-head table,.table-body table{width:100%;}
    /*.table-body table tr:nth-child(2n+1){background-color: #CDCDCD;}*/

    .table-body table tr:hover {
        background-color:#dff0d8;
        transition: .2s;
    }
    .table-body table tr:hover td{background-color:rgb(240, 249, 228);}
</style>

<script th:src="@{/js/vote/list_kangjun_vote.js?v=1.04}"></script>

<script type="text/javascript">
    var ID = $("#id").val();
    $(function() {
        if(ID==""){
            alert("请先登录！");
            location.href='../main/login';
        }
    });

    // //获取要定位元素距离浏览器顶部的距离
    //              var navH = $(".primary-title").offset().top;
    //              alert(navH)
    //              //滚动条事件
    //               $(window).scroll(function() {
    //                      //获取滚动条的滑动距离
    //                       var scroH = $(this).scrollTop();
    //                        //滚动条的滑动距离大于等于定位元素距离浏览器顶部的距离，就固定，反之就不固定
    //                   if (scroH >= navH) {
    //                              $(".primary-title").css({ "position": "fixed", "top": 0 });
    //                          }
    //                      else if (scroH < navH) {
    //                              $(".primary-title").css({ "position": "static" });
    //                         }
    //                  })

    // $(document).ready(function () {
    //     $("#tabhead").css("width", $("#Tab_biaojue").css("width"));
    //     $("#List").scroll(function () { // 滚动条移动事件
    //         var yheight = $("#List").scrollTop(); // 滚动条距顶端的距离
    //         $("#tabhead").css("top", yheight + "px");
    //     });
    // });



    function toVote(ppId,ppPinzhong,ppPingui){
        var ppResult="";
        if($("#checkbox_"+ppPinzhong+"_"+ppPingui+"").is(":checked")){
            ppResult="1";
        }else {
            ppResult="0";
        }
        layer.open({type: 3});
        $.post('/kangjunyaowujieguo/toupiao', {
            id: ppId,
            pinzhong:ppPinzhong,
            pingui:ppPingui,
            userid:$("#id").val(),
            result: ppResult,
            rdm: Math.random()
        }, function (ppData) {
            layer.closeAll("loading");
            if (ppData != null) {
                if (ppData.result == "1") {
                    //
                    // if(ppResult=="1"){
                    //     $("#div_"+ppPinzhong+"_"+ppPingui+"").html("<span style=\"color:#008000\">保留</span>");
                    //
                    // }
                    // if(ppResult=="0"){
                    //     $("#div_"+ppPinzhong+"_"+ppPingui+"").html("<span style=\"color:#ff0000\">淘汰</span>");
                    // }
                    vote.getkangjunResultCount();
                } else {
                    layer.alert(ppData.message);
                    //$("#checkbox_"+ppPinzhong+"_"+ppPingui+"").attr("checked","false")
                    //vote.findBiaojuelist();
                    $("#div_"+ppPinzhong+"_"+ppPingui+"").html("<input onclick=\"toVote('"+ppId+"','"+ppPinzhong+"','"+ppPingui+"')\" id='checkbox_"+ppPinzhong+"_"+ppPingui+"' class='cbcss' type=\"checkbox\">");
                }
            }
        }, "json");

    }
    function toVoteSure(ppXiangmuId){

        layer.open({type: 3});
        $.post('/kangjunyaowujieguo/votesure', {
            xiangmuid: ppXiangmuId,
            userid:$("#id").val(),
            rdm: Math.random()
        }, function (ppData) {
            layer.closeAll("loading");
            if (ppData != null) {
                if (ppData.result == "1") {
                    location.reload()
                    //vote.getkangjunResultCount();
                } else {
                    layer.alert(ppData.message);
                }
            }
        }, "json");
    }


</script>
<style>
    a {
        text-decoration: none;
        color:#333;
    }
    /*正常的未被访问过的链接*/
    a:link {
        text-decoration: none;
    }
    /*已经访问过的链接*/
    a:visited {
        text-decoration: none;
    }
    /*鼠标划过(停留)的链接*/
    a:hover {
        text-decoration: none;
    }
    /* 正在点击的链接*/
    a:active {
        text-decoration: none;
    }

    .tt {
        /*display:table;*/
        width: 100%;
        /*background-color: lightblue;*/
        position: fixed;
        /*top:0;*/
    }

    /*table thead{*/
    /*    position: fixed;*/
    /*    width: inherit*/
    /*}*/
    /*table thead tr{*/
    /*    width: 100%;*/
    /*}*/

    .select-form-control {
        /* display: block; */
        /* width: 100%; */
        height: 34px;
        padding: 6px 12px;
        font-size: 14px;
        line-height: 1.42857143;
        color: #555;
        background-color: #fff;
        background-image: none;
        border: 1px solid #ccc;
        border-radius: 4px;
        -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
        -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
        -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
        transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    }


    /*table tbody {*/
    /*    display: block;*/
    /*    height: 1000px;*/
    /*    overflow-y: scroll;*/
    /*}*/
    /*table thead, tbody tr {*/
    /*    display: table;*/
    /*    width: 100%;*/
    /*    table-layout: fixed;*/
    /*}*/
    /*table thead {*/
    /*    width: calc( 100% - 1em );*/
    /*}*/
    /*table thead th {*/
    /*    background: #ccc;*/
    /*}*/





</style>
</html>